package com.library.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Book implements Serializable {

    private static final long serialVersionUID = 1L;

    private Long id;

    //书籍标题
    private String title;

    //作者
    private String author;

    //ISBN
    private String isbn;

    //出版时间
    //@DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate  publishDate;

    //书本分类id
    private Long categoryId;

    //书价格
    private BigDecimal price;

    //书籍封面图片
    private String cover;

    //书籍描述
    private String description;

    //书籍库存
    private Integer stock;

    //书籍已借出数目
    private Integer borrowed;

    //创建时间
    private LocalDateTime createTime;

    //更新时间
    private LocalDateTime updateTime;

}
